package com.supermap.business.cloud.agrinfo.farm;

import com.alibaba.dubbo.config.annotation.Reference;
import com.supermap.dataservice.mysql.config.DynamicDataSourceContextHolder;
import com.supermap.dataservice.util.JSONUtil;
import com.supermap.dubbo.api.cloud.farm.CroplandService;
import com.supermap.dubbo.api.cq.epproduct.CountEPCountSumService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * @author aqua
 * @description
 * @date 2018年11月14 上午 9:47
 * @email 1301584033@qq.com
 */
@Controller
@RequestMapping("/cloud/farm")
public class CroplandController {
    @Reference(timeout = 100000)
    private CroplandService croplandService;

    @Reference(timeout = 100000)
    private CountEPCountSumService countEPCountSumService;

    /**
     *
     * 农田相关的农情
     */
    @RequestMapping("/getFarmLandById")
    @ResponseBody
    List<Map<String,Object>> getFarmLandById(String farmId, String pageNum, String pageSize){
            return  croplandService.getFarmLandById(farmId,pageNum,pageSize);
    };

    /**
     *
     * 农田相关农田咨询
     */
    @RequestMapping("/getAdvFarmById")
    @ResponseBody
    List<Map<String,Object>>  getAdvFarmById(String farmId,String pageNum,String pageSize){
        return  croplandService.getAdvFarmById(farmId,pageNum,pageSize);
    }


    /**
     *
     * 农田相关灾情
     */
    @RequestMapping("/getDisasterFarmById")
    @ResponseBody
    List<Map<String,Object>>  getDisasterFarmById(String farmId,String pageNum,String pageSize){
        return  croplandService.getDisasterFarmById(farmId,pageNum,pageSize);
    }
    @RequestMapping("/getProfvipcontentFarmById")
    @ResponseBody
    public List<Map<String, Object>> getProfvipcontentFarmById(String farmId, String pageNum, String pageSize) {
       return   countEPCountSumService.getProfvipcontentFarmById(farmId,pageNum,pageSize);
    }





}
